cmake_minimum_required(VERSION 3.5)

project(NeoFluentExample VERSION 0.1 LANGUAGES CXX)

# Set the some basic compiler flags
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_PREFIX_PATH "C:/Qt/5.15.2/msvc2019_64/include")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

# Find the Qt libraries
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Core Gui)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Core Gui)

file(GLOB INCLUDES "source/include/*.h")
file(GLOB PRIVATES "source/private/*")
file(GLOB STYLE "source/style/*")
file(GLOB COMMON "source/common/*")
file(GLOB ORGINS "source/*.cpp")
file(GLOB RCC "source/include/*.qrc")

set(PROJECT_SOURCES
    ${INCLUDES}
    ${PRIVATES}
    ${ORGINS}
    ${STYLE}
    ${COMMON}
    ${RCC}
    example/main.cpp
)

# Add the executable target
add_executable(${PROJECT_NAME} ${PROJECT_SOURCES})

target_include_directories(${PROJECT_NAME} PRIVATE
    "${CMAKE_CURRENT_SOURCE_DIR}/source"
    "${CMAKE_CURRENT_SOURCE_DIR}/source/include"
    "${CMAKE_CURRENT_SOURCE_DIR}/source/private"
    "${CMAKE_CURRENT_SOURCE_DIR}/source/style"
    "${CMAKE_CURRENT_SOURCE_DIR}/source/common"
)

# Link the Qt libraries
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui)
